package org.jetlinks.pro.elastic.search;

import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.ArgumentsProvider;

import java.util.stream.Stream;

class ElasticSearchVersionArgumentsProvider implements ArgumentsProvider {

    private final String[] version = System
        .getProperty("elasticsearch.versions", "6.8.0,7.3.0,7.11.2,7.14.1")
        .split(",");

    @Override
    public Stream<? extends Arguments> provideArguments(ExtensionContext context) throws Exception {

        return Stream
            .of(
                version
            ).map(Arguments::of);
    }
}
